//
//  ViewController.m
//  BezierDemo
//
//  Created by yuanjiang on 2017/12/14.
//  Copyright © 2017年 yuanjiang. All rights reserved.
//

#import "ViewController.h"
#import "BingZhuangTu.h"
#import "ShuangZheXianTu.h"
#import "ZheXianTu.h"
#import "ZhuZhuangTu.h"
#import "DrawLineVC.h"
#import "DrawCornerVC.h"



static NSString *cellId  = @"cellId";

@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@property(nonatomic,strong) NSMutableArray *mutarray;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.navigationItem.title = @"图画练习";
    self.tableView.tableFooterView = [UIView new];

}


-(NSMutableArray *)mutarray
{
    if (!_mutarray) {
        _mutarray = [NSMutableArray arrayWithObjects:@"饼状图",@"双折线",@"折线图",@"柱状图",@"在view上划线",@"画圆角", nil];
    }
    return _mutarray;
}

//MARK: - UITableViewDelegate UITableViewDataSource
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.mutarray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
    }
    cell.textLabel.text = self.mutarray[indexPath.row];
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    switch (indexPath.row) {
        case 0:
        {
            BingZhuangTu *vc = [[BingZhuangTu alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 1:
        {
            ShuangZheXianTu *vc = [[ShuangZheXianTu alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 2:
        {
            ZheXianTu *vc = [[ZheXianTu alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 3:
        {
            ZhuZhuangTu *vc = [[ZhuZhuangTu alloc] init];
            [self.navigationController pushViewController:vc animated: YES];
            break;
        }
        case 4:
        {
            DrawLineVC *vc = [[DrawLineVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            break;
            
        }
        case 5:
        {
            DrawCornerVC *vc = [[DrawCornerVC alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            break;
            
        }
            break;
        default:
            break;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
